package com.songshuai.pangu.api.config;

import com.songshuai.webapi.baseapi.utils.OssUploadUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * 阿里云配置
 * @Author: lhx
 * @Date: 2018/11/23 17:24
 * @Version 1.0
 */
@Configuration
public class OssConfig {

    @Value("${aliyun.oss.accessKeyId}")
    private String accessKeyId;

    @Value("${aliyun.oss.accessKeySecret}")
    private String accessKeySecret;

    @Value("${aliyun.oss.endpoint}")
    private String endpoint;

    @Value("${aliyun.oss.bucketName}")
    private String buckteName;


    @Bean
    @Scope("prototype")
    public OssUploadUtil ossUploadUtil(){
        return OssUploadUtil.build(buckteName,endpoint,accessKeyId,accessKeySecret);
    }



}
